import React, { Component } from 'react';
import {
	StyleSheet, Text, View, TouchableOpacity, Image
} from "react-native";
import { GLOBAL } from '../../../../config/global';
import { style } from '../../../../theme/style';
const scale = GLOBAL.SCALE;

export class Tabs extends Component {
	constructor(props) {
		super(props);
	}

	render() {
		const { tabIndex, checkTab } = this.props;
		return (
			<View style={styles.tabTop}>
				<TouchableOpacity onPress={() => { checkTab(0) }} style={styles.tabBox}>
					<Text style={[styles.TabText, { opacity: tabIndex === 0 ? 1 : 0.8 }]}>采购成交
					{/* <Text style={{ fontSize: 18 * scale, Left: 8 * scale }}> {6}</Text> */}
					</Text>
				</TouchableOpacity>
				<TouchableOpacity onPress={() => { checkTab(1) }} style={styles.tabBox}>
					<Text style={[styles.TabText, { opacity: tabIndex === 1 ? 1 : 0.8 }]}>销售成交
					{/* <Text style={{ fontSize: 18 * scale, Left: 8 * scale }}> {8}</Text> */}
					</Text>
				</TouchableOpacity>
				<TouchableOpacity onPress={() => { checkTab(2) }} style={styles.tabBox}>
					<Text style={[styles.TabText, { opacity: tabIndex === 2 ? 1 : 0.8 }]}>闭口成交
					{/* <Text style={{ fontSize: 18 * scale, Left: 8 * scale }}> {10}</Text> */}
					</Text>
				</TouchableOpacity>
			</View >
		)
	}
}
const styles = StyleSheet.create({
	tabTop: {
		height: 84 * scale,
		backgroundColor: style.color.themeColor,
		flexDirection: 'row',
		justifyContent: 'space-around',
		alignItems: 'center',
		// marginBottom: 70 * scale,
	},
	tabBox: {
		width: '50%',
		height: 40 * scale,
		marginTop: 5 * scale,
		alignItems: 'center',
		justifyContent: 'space-between'
	},
	TabText: {
		fontSize: 14 * scale,
		color: style.color.white,
		textAlign: 'center'
	},
})